 <script language="javascript">
	function goback(){
		document.forms[0].action='<?=site_url("job_management/goto_announce_view")?>';
		document.forms[0].submit();
	}
	function goaddnewtitle(comid,announid){
		document.forms[0].action='<?=site_url("job_management/goto_addnew_title")?>/'+ comid + '/'+ announid;
		document.forms[0].submit();
	}
	function deletetitle(titleid,comid){
		if(confirm("Do you want to delete this title?","Delete title")){
			document.forms[0].action='<?=site_url("job_management/delete_title")?>/'+ titleid + '/'+ comid;
			document.forms[0].submit();
		}
	}
</script>
	<h3 class="capture">Job Management</h3>
    <div id="wrap">
    <div id="tdd_selected">
    	<div class="dd_selected">Title View</div>
        <div class="dd_view"><br />
        <form action="" method="post">
        <div>
        	Company:<input type="text" readonly="readonly" id="txtcompany" name="txtcompany" value="<?=htmlspecialchars($company['com_name']);?>" />
            <?php $comid=$company['com_id'];?>
        </div>
        	<table width="600" border="0" align="center" cellpadding="0" cellspacing="0" class="userview">
        		<tr>
        			<th>Title Id</th>
        			<th>Title Description</th>
                    <th>Category</th>
                    <th>Duty</th>
                    <th>Requirement</th>
                    <th>Location</th>
                    <th>Schedule</th>
        			<th>Delete</th>
        		</tr>
        		 
        		<?php foreach($all_title->result() as $title): 
				 		$duty=$this->m_job->get_number_duty($title->title_id); 
						$requirement=$this->m_job->get_number_requirement($title->title_id);
						$category=$this->m_job->get_number_category($title->title_id);
						$location=$this->m_job->get_number_location($title->title_id);
						$schedule=$this->m_job->get_number_schedule($title->title_id);
				?>
                  <tr onmouseover="this.style.backgroundColor='#ffff66';" onmouseout="this.style.backgroundColor='#d4e3e5';">
                    <td><a href="<?=site_url("job_management/goto_update_title/$title->title_id/$comid");?>"><?=htmlspecialchars($title->title_id);?></a></td>
                   	<td><?=htmlspecialchars($title->title_desc);?></td>
                    <td><a href="<?=site_url("job_management/goto_view_category_titleid/$title->title_id")?>"><?=count($category->result());?></a></td>
                    <td><a href="<?=site_url("job_management/goto_duty_view/$title->title_id")?>"><?=count($duty->result());?></a></td>
                    <td><a href="<?=site_url("job_management/goto_requirement_view/$title->title_id")?>"><?=count($requirement->result());?></a></td>
                    <td><a href="<?=site_url("job_management/goto_view_location_titleid/$title->title_id")?>"><?=count($location->result());?></a></td>
                    <td><a href="<?=site_url("job_management/goto_view_schedule_titleid/$title->title_id")?>"><?=count($schedule->result());?></a></td>
                    <td align="center"><img src="<?=base_url();?>images/recyclebin.png" width="20px" height="20px" onclick="deletetitle('<?=$title->title_id;?>','<?=$company['com_id'];?>')" /></td>
                  </tr>
              	<?php endforeach; ?>
            </table><br />
           <div align="center">
	           <input type="button" name="btnback" value="Back" class="bottom" onclick="goback()" />
	           <input type="button" name="btnaddnew" class="bottom" value="Add New" onclick="goaddnewtitle('<?=$company['com_id'];?>','<?=$announceid;?>')" />
	       </div><br />
        </form>
		</div>
        
    </div> 
      
  </div>


